﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace xiaolanshu
{
    public partial class 小兰书论坛 : Form
    {
        public static int m = 12;
        public static int n = 150;
        public static string yhm;
        发帖 b = null;
        public 小兰书论坛()
        {
            InitializeComponent();
            b = new 发帖();
            b.myevent += new 发帖.mydelegate(b_myevent);
        }
        void b_myevent()
        {
            n = n + 200;
            气泡 a = new 气泡();
            a.richTextBox1.Text = 发帖.ll;
            a.richTextBox1.ForeColor = 发帖.se;
            a.Location = new Point(m, n);
           /* SqlConnection conn = SQLTools.conn;
           
            //SqlConnection conn = new SqlConnection(@"Database=小兰书;Server=.\SqlExpress;Integrated Security=SSPI;");
            string sql = @"select 用户名 from 用户 where 电话号=@tel";
            SqlCommand cmd = new SqlCommand(sql,conn);
            if (cmd.Connection.State == ConnectionState.Open)
            {
                cmd.Connection.Close();
            }
            conn.Open();
            cmd.Parameters.Add("@telephone", SqlDbType.Char, 11).Value = 用户登录.a;
            //a.groupBox1.Text = 用户信息.pname;
             yhm= cmd.ExecuteScalar().ToString();*/
            Controls.Add(a);
            
        }
        private void 小兰书论坛_Load(object sender, EventArgs e)
        {
            m = 12;n = 150;
            气泡 a = new 气泡();
            a.richTextBox1.Text = "小兰书欢迎您！";
            a.Location = new Point(m, n);
            Controls.Add(a);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            b.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
